import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int size = scan.nextInt();
        int k = scan.nextInt();
        int sum = 0;
        int len = 0;
        int[] array = new int[size];
        for (int i = 0; i < size; i++) {
            int tmp = scan.nextInt();
            if (tmp % 2 != 0) {
                sum += tmp;
            } else {
                array[len++] = tmp;
            }
        }
        PriorityQueue<Integer> heap = new PriorityQueue<>(new Incmp());
        for (int i = 0; i < len; i++) {
            heap.offer(array[i]);
        }
        for (int i = 0; i < k; i++) {
            int tmp = heap.poll() ;
            if(tmp %2 == 0){
                tmp /= 2 ;
                heap.offer(tmp);
            }else{
                
            }
        }



    }

}
class Incmp implements Comparator<Integer>{
    @Override
    public int compare(Integer o1, Integer o2) {
        return o2 - o1;
    }
}